<?php

class Page extends AppModel
{
	var $name = 'Page';
	var $belongsTo = array(
			'User' => array('classname' => 'User',
							'foreign_key' => 'user_id'),
			'Copyright' => array('classname'=>'Copyright',
							'foreignKey'=>'copyright_id'),
			'Subject' => array('classname'=>'Subject',
							'foerignKey'=>'subject_id')
		
	);
	
	function beforeSave()
    {
    	$this->data[$this->name]['url'] = $this->getUniqueUrl($this->data[$this->name]['title'], 'url');
        
        return true;
    } 
}
?>